{extend name="base" /}
{block name="body"}
<div class="layui-card">
	<div class="layui-card-body">
        <div class="layui-btn-group">
		    <a href="{:url('user/usergroup/add')}" class="layui-btn"><i class="fa fa-plus-circle"></i> 添加</a>
        </div>
		<table class="layui-table layui-form">
			<thead>
				<tr>
					<th>ID</th>
					<th>权限名称</th>
					<th>描述</th>
					<th>状态</th>
					<th>操作</th>
				</tr>
			</thead>
			<tbody>
				{foreach name="list" item="v" empty="$empty"}
				<tr>
					<td>{$v.id}</td>
					<td>{neq name="v.level" value="1"}|{php}for($i=1;$i<$v['level'];$i++){echo ' ----';}{/php}{/neq} <b>{$v.name}</b></td>
					<td>{$v.description}</td>
					<td>
						<input type="checkbox" name="status" lay-skin="switch" lay-filter="*" lay-text="启用|禁用" data-url="{:url('user/usergroup/editGroup', ['id' => $v.id])}" {if $v.status eq 1}checked="checked"{/if}>
					</td>
					<td>
						<a href="{:url('user/usergroup/edit', ['id' => $v.id])}" class="layui-btn layui-btn-sm layui-btn-normal"><i class="fa fa-edit"></i> 编辑</a>
						<a href="{:url('user/usergroup/del', ['id' => $v.id])}" class="layui-btn layui-btn-sm layui-btn-danger ajax-delete"><i class="fa fa-trash-o"></i> 删除</a>
					</td>
				</tr>
				{/foreach}
			</tbody>
		</table>
	</div>
</div>
{/block}
